import {
  businessTypeMap,
  businessLevelMap,
  dataSystemMap
} from '@/config/dict'

export const queryFormItem = [
  {
    type: 'select',
    key: 'businessType',
    // label: '业务类型',
    options: businessTypeMap,
    otherAttrs: {
      style: {
        width: '110px'
      },
      placeholder: '业务类型'
    }
  },
  {
    type: 'select',
    key: 'businessLevel',
    // label: '业务级别',
    options: businessLevelMap,
    otherAttrs: {
      style: {
        width: '110px'
      },
      placeholder: '业务级别'
    }
  },
  {
    type: 'select',
    key: 'notifySofts',
    // label: '数据系统',
    // 1=凤凰芯  2=碧邦app 3=大管家app
    options: dataSystemMap,
    otherAttrs: {
      style: {
        width: '110px'
      },
      placeholder: '数据系统'
    }
  },
  {
    type: 'date',
    key: 'beginTime',
    // label: '开始时间',
    otherAttrs: {
      style: {
        width: '140px'
      },
      placeholder: '开始日期'
    }
  },
  {
    type: 'date',
    key: 'endTime',
    // label: '结束时间,'
    otherAttrs: {
      style: {
        width: '140px'
      },
      placeholder: '结束日期'
    }
  }
]
export const tableColumn = (page, size) => {
  return [
    {
      key: 'name',
      label: '业务名称',
      minWidth: 200
    },
    {
      key: 'businessType',
      label: '业务类型',
      minWidth: 80
    },
    {
      key: 'notifySoftsName',
      label: '数据系统',
      minWidth: 200
    },
    {
      key: 'businessLevelName',
      label: '业务级别',
      minWidth: 80
    },
    {
      key: 'kpiname',
      label: '考核指标',
      minWidth: 160,
      render: (h, scope) => (
        <span
          style={
            'overflow: hidden; textOverflow: ellipsis; whiteSpace: nowrap;'
          }
        >
          {scope.row.kpiname}
        </span>
      )
    },
    {
      key: 'kpideptname',
      label: '考核部门',
      minWidth: 200,
      render: (h, scope) => (
        <span
          style={
            'overflow: hidden; textOverflow: ellipsis; whiteSpace: nowrap;'
          }
        >
          {scope.row.kpideptname}
        </span>
      )
    },
    // {
    //   key: 'createTime',
    //   label: '创建时间',
    //   minWidth: 140
    // },
    {
      key: 'level1',
      label: '一级预警',
      minWidth: 80
    },
    {
      key: 'level2',
      label: '二级预警',
      minWidth: 80
    },
    {
      key: 'level3',
      label: '三级预警',
      minWidth: 80
    },
    {
      key: 'level4',
      label: '四级预警',
      minWidth: 80
    }
  ]
}
